package com.bestcem.xm.user.mq.sender;

import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * 用户邮箱配置相关消息发送服务
 *
 * @author qiongyu.cui <qiongyu.cui@idiaoyan.com>
 * @version v1.0
 * @date 2022/3/17 15:30
 */
@Slf4j
//@Component("userSmtpMessageSender")
@Deprecated
public class UserSmtpMessageSender {
    //@Resource
    //private RabbitMqConstantConfig rabbitMqConstantConfig;
    //@Resource
    //private RabbitMessageSender rabbitMessageSender;

    /**
     * 删除邮箱发消息
     *
     * @param smtpIds 邮箱id列表
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/03/17 15:33
     */
    public void publishSmtpDelete(List<String> smtpIds) {
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            UserSmtpTopics.USER_SMTP_DELETED, smtpIds);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            UserSmtpTopics.USER_SMTP_DELETED, smtpIds);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Smtp] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                UserSmtpTopics.USER_SMTP_DELETED, JSON.toJSONString(smtpIds));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Smtp] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            UserSmtpTopics.USER_SMTP_DELETED, JSON.toJSONString(smtpIds));
        //}
    }

}
